﻿using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using SmartCity.Shared;
using Volo.Abp;
using Volo.Abp.AspNetCore.Mvc;

namespace CommonManagement
{
    /// <summary>
    /// 商品控制器
    /// </summary>
    [Authorize]
    [RemoteService]
    [Area("commonManagement")]
    [Route("api/commonManagement/products")]
    public class ProductController : AbpController, IProductAppService
    {
        private readonly IProductAppService _productAppService;

        public ProductController(
            IProductAppService productAppService)
        {
            _productAppService = productAppService;
        }

        // 分页列表
        [HttpGet]
        [Route("list")]
        public Task<ListResponse<ProductDto>> PagedListAsync(PagedListRequest request, string description, string name)
        {
            return _productAppService.PagedListAsync(request, description, name);
        }
    }
}